@use './bem.scss' as BEM;

a {
    text-decoration: none;
    color: inherit;
    cursor: default;
}

.rql-editor {
    font-size: 17px;
    line-height: 27px;
    font-weight: 400;
    color: #2f3238;
    border: none !important;

    .ql-editor {
        padding: 16px 12px;
        padding-bottom: 30px;
        text-align: justify;
        word-break: break-all;
        letter-spacing: 0;
        word-wrap: break-word;

        &::before {
            font-size: inherit;
            color: #9499a0;
            line-height: inherit;
            font-style: normal;
            font-weight: inherit;
        }

        .card,
        blockquote,
        h1,
        h2,
        ol,
        p,
        ul {
            margin-bottom: 20px;
        }

        h1 {
            font-size: 22px;
            line-height: 31px;
        }

        h2 {
            font-size: 18px;
            line-height: 25px;
        }

        blockquote {
            border-left: 4px solid #e3e5e7;
            padding-left: 10px;
        }

        img {
            margin: 10px 0;
            max-width: 100%;
        }

        .link {
            cursor: pointer;
            color: #00aeec;

            &::before {
                content: "";
                display: inline-block;
                height: 1.4em;
                width: 1.4em;
                vertical-align: -6px;
                background: url() 50%/contain no-repeat;
            }
        }
    }

    :not(.ql-disabled) {
        p>img {
            pointer-events: none;

            &[data-status="pending"] {
                animation: breath 2s ease-in-out 0s infinite;
            }
        }

        p.normal-img {
            &:hover img {
                outline: 2px solid rgba(0, 226, 255, .4);
            }

            &.focused img {
                outline: 2px solid #37c8f7;
            }


        }

        div.card>img {
            border-radius: 2px;
            pointer-events: none;
        }

        div.card:hover img {
            outline: 2px solid rgba(0, 226, 255, .4);
        }

        div.card.focused img {
            outline: 2px solid #37c8f7;
        }
    }
}

.rql-editor .ql-editor .card {
    margin: 10px 0;
}

@include BEM.b(read-editor) {
    svg {
        fill: none;
        width: inherit;
        height: inherit;
    }

    width: 740px;
    position: relative;
    border: 1px solid #e5e9ef;
    border-radius: 4px;
    padding: 0 40px;
    background-color: #fff;
    font: 12px / 1.5 Helvetica Neue,
    Helvetica,
    PingFang SC,
    Hiragino Sans GB,
    Microsoft YaHei,
    \\5FAE软雅黑,
    Arial,
    sans-serif;
    color: #222;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-rendering: optimizelegibility;
    -webkit-font-smoothing: antialiased;

    @include BEM.e(input) {
        padding: 30px 0;
        width: 100%;
    }

    @include BEM.e(field) {
        min-height: 200px;
        font-size: 14px;
        font-family: -apple-system, Helvetica Neue, Arial, PingFang SC,
            Hiragino Sans GB, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;
        font-weight: 400;
        line-height: 1.7;
        border: none;
        width: 100%;

        .ql-editor {
            max-height: 100vh;
            overflow-y: auto;
        }
    }

    @include BEM.e(hint) {
        text-align: right;
        color: #99a2aa;
        line-height: 1;
    }
}

.bre-toolbar {
    padding: 0 8px;
    background-color: #f1f3f7;
    width: 100%;
    height: 42px;
    display: flex;
    align-items: center;

    &__optbtn {
        cursor: pointer;
        list-style: none;
    }

    &__optlist {
        &.text-size {
            width: 109px;
            padding: 6px 0;

            .bre-toolbar__optbtn {
                height: 32px;
                padding-left: 12px;
                user-select: none;
                display: flex;
                align-items: center;
                color: #18191c;
                font-size: 12px;

                &:hover {
                    color: #00aeec;
                }

                &__icon {
                    width: 20px;
                    height: 20px;
                }

                &__lab {
                    width: 58px;
                    text-align: left;
                    margin-left: 4px;
                }
            }
        }

        &.divline {
            .bre-toolbar__optbtn {
                padding: 5px 10px;
                height: 30px;
                width: 100%;
                background-color: #f1f3f7;
                border-radius: 2px;

                &:not(:first-child) {
                    margin-top: 1px;
                }

                &:hover {
                    outline: 1px solid #00aeec;
                }

                img {
                    width: 106px;
                    height: 20px;
                    object-fit: contain;
                }
            }
        }

        &.icons {
            width: 38px;

            .bre-toolbar__optbtn {
                padding: 7px;

                &:hover {
                    color: #00aeec;
                }

                &__icon {
                    width: 24px;
                    height: 24px;
                }
            }
        }

        &.pic {
            width: 140px;

            .bre-toolbar__optbtn {
                padding: 7px 10px;
                user-select: none;
                color: #18191c;
                font-size: 12px;

                &:hover {
                    color: #00aeec;
                }

                &__lab {
                    text-align: left;
                }
            }
        }

        &.more {
            width: 120px;
            display: flex;
            flex-direction: column;
            flex-wrap: wrap;

            .bre-toolbar__optbtn {
                width: 60px;
                padding: 7px 10px;
                user-select: none;
                color: #18191c;
                font-size: 12px;

                &:hover {
                    color: #00aeec;
                }

                &__lab {
                    text-align: left;
                }
            }
        }
    }

    &__div {
        border-left: 1px solid #fff;
        cursor: default;
        height: 100%;
        padding: 0;
        margin: 0 8px;
    }

    &__savestatus {
        margin-left: auto;
        color: #9499a0;
        width: 56px;
        padding: 10px;
        user-select: none;
    }

    &__colorpicker {
        font-size: 12px;
        background-color: #fff;

        &__ceiling {
            background: #f1f3f7;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            width: 172px;
            padding: 10px 8px;

            &:not(:first-child) {
                margin-top: 1px;
            }
        }

        &__tile {
            cursor: pointer;
            width: 20px;
            height: 20px;
            border: 1px solid #f1f3f7;
            border-radius: 4px;
            outline: 1px solid transparent;
            box-sizing: border-box;
            margin: 3px;

            &.active {
                outline-color: #00aeec;
            }

            &:hover {
                box-shadow: 0 0 4px 0 #00e2ff;
                border-color: #fff !important;
            }
        }
    }


    .tlbr-btn.preview {
        color: #9499a0;
    }
}

.tlbr-btn {
    width: 32px;
    height: 100%;
    color: #18191c;
    border: none;
    outline: none;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;

    &__icon {
        pointer-events: none;
        width: 24px;
        height: 24px;
    }

    &__more {
        display: none;
        cursor: default;
        position: absolute;
        z-index: 2;
        left: 0;
        top: 42px;
        padding-top: 2px;

        &__tooltip {
            background: #f1f3f7;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
            border-radius: 2px;
        }
    }

    &__dot {
        pointer-events: none;
        position: absolute;
        right: 4px;
        bottom: 9px;
        width: 4px !important;
        height: 4px !important;
    }

    &+& {
        margin-left: 6px;
    }

    &:hover.hm {
        .tlbr-btn__more {
            display: block;
        }
    }

    &:hover:not(.hm) {
        .tlbr-btn__icon {
            color: #00aeec;
        }
    }

    &.active {
        .tlbr-btn__icon {
            color: #00aeec;
        }
    }
}

.mt-s {
    margin-top: 10px;
}

.mt-m {
    margin-top: 20px;
}

.mt-l {
    margin-top: 30px;
}

.mb-s {
    margin-bottom: 10px;
}

.mb-m {
    margin-bottom: 20px;
}

.mb-l {
    margin-bottom: 30px;
}

@keyframes breath {
    0% {
        opacity: 1;
        /* 完全不透明 */
    }

    50% {
        opacity: 0.4;
        /* 半透明 */
    }

    100% {
        opacity: 1;
        /* 完全不透明 */
    }
}

.cut-off {
    text-align: center;

    &[data-type="0"]>img {
        height: 1px;
    }

    &[data-type="1"]>img {
        height: 2px;
    }

    &[data-type="2"]>img {
        height: 4px;
    }

    &[data-type="3"]>img,
    &[data-type="4"]>img {
        height: 16px;
    }

    &[data-type="5"]>img {
        max-height: 64px;
    }
}

.bre-modal {
    &__wrap {
        padding: 0 20px 20px;
        width: 350px;
        background-color: #fff;
        z-index: 100;
        margin: auto;
        top: 10%;
        right: 0;
        left: 0;
        position: fixed;
        border-radius: 4px;
        animation: popin .3s;
        -ms-animation: popin .3s;
        -moz-animation: popin .3s;
        -webkit-animation: popin .3s;
        border: 1px solid #e5e9ef;
        box-shadow: 0 2px 4px rgba(0, 0, 0, .16);
        max-height: 80%;
        overflow: hidden;
        display: flex;
        flex-direction: column;

        &::after {
            content: "";
            display: block;
            clear: both;
        }
    }

    &__header {
        border-bottom: 1px solid #e5e9ef;
        margin: 0 -20px;
        padding: 16px;
        font-size: 14px;
        display: flex;
        justify-content: space-between;
        flex-shrink: 0;
    }

    &__close {
        position: absolute;
        right: 14px;
        top: 14px;
        cursor: pointer;
        color: #99a2aa;

        &,
        & svg {
            width: 24px;
            height: 24px;
        }
    }

    &__content {
        flex-shrink: 1;
        overflow: hidden;
        -webkit-font-smoothing: antialiased;
    }

    &__form {
        padding-top: 15px;
    }


}

.bre-input {
    width: 100%;
    display: inline-block;
    position: relative;

    &__inner {
        border-radius: 4px;
        border: 1px solid #e3e5e7;
        box-sizing: border-box;
        transition: color .2s ease, background-color .2s ease, border-color .2s ease;
        width: 100%;
        font-size: 14px;
        line-height: 1;
        padding: 7px 12px;
        outline: none;
    }
}

.bre-link-modal {
    &__form {
        padding-top: 15px;

        &__btns {
            text-align: right;
            margin-top: 15px;
        }
    }

    &__btn {
        &+& {
            margin-left: 10px;
        }
    }
}

.bre-btn {
    cursor: pointer;
    border: 0;
    border-radius: 32px;
    height: 37px;
    line-height: 32px;
    min-width: 110px;
    padding: 0 15px;
    border: 1px solid #e3e5e7;
    background-color: #fff;
    color: #61666d;
    transition: .2s;

    &.primary {
        border-color: #37c8f7;
        background-color: #37c8f7;
        color: #fff;

        &:hover {
            border-color: #57dfff;
            background-color: #57dfff;
        }
    }

    &.grey {
        border-color: transparent;
        background-color: #f1f3f7;
        color: #6d757a;

        &:hover {
            background-color: #e5e9ef;
        }
    }

    &.size--small {
        border-radius: 16px;
        height: 32px;
        min-width: 90px;
        line-height: 32px;
    }



}

@keyframes popin {
    0% {
        opacity: 0;
        transform: scale(.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}


#canvas-wrap {
    width: 658PX !important;
}